/**
 * JQ原理封装
 * params window     赋值给window,全局使用
 * params undefined  避免低版本浏览器串改
 */
; (function (window, undefined) {
    function init(ele) {
        //用qsa 将ele保存起来
        let eles = document.querySelectorAll(ele)
        //遍历
        for (let i = 0; i < eles.length; i++) {
            this[i] = eles[i]
        }
        this.length = eles.length
    }

    let jQuery = function (ele) {
        return new init(ele)
    }

    //给jq增加快捷操作,(静态方法),改静态方法可以改init的原型方法
    jQuery.extend = function (object) {
        for (let key in object) {
            init.prototype[key] = object[key]
        }
    }

    //css属性
    init.prototype.css = function (cssName, cssValue) {
        for (let i = 0; i < this.length; i++) {
            this[i].style[cssName] = cssValue
        }
    }
    //ajax
    init.prototype.ajax=function(options){}
    //attr
    init.prototype.attr=function(options){}
    //addclass
    init.prototype.addclass=function(options){}
    //get
    init.prototype.get=function(options){}
    //post
    init.prototype.post=function(options){}


    window.jQuery=window.$=jQuery
})(window)
$.extend({
    bgk(){}
})